package com.os.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.os.service.DeskServiceS;
import com.os.serviceimpl.DeskServiceImplS;

import net.sf.json.JSONObject;
/**
 * 
 * @author HQG 2017年1月6日
 *
 */
public class CheckDeskControllerH extends HttpServlet{

	DeskServiceS ds = new DeskServiceImplS();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		PrintWriter pw = resp.getWriter();
		HttpSession session = req.getSession();
		int oid = Integer.parseInt(req.getParameter("oid"));
		JSONObject jo = ds.checkDeskH(oid);
		session.setAttribute("oidH", oid);
		pw.write(jo.toString());
		pw.flush();
		pw.close();
	}
	
}
